<?php ?>
<script type="text/javascript">
var arrayData = new Array();

function mostrarVentana(idVentana) 
{
	var ventana = document.getElementById(idVentana);
    ventana.style.marginTop = '100px';
    ventana.style.left = ((document.body.clientWidth-350) / 2) +  'px';
    ventana.style.display = 'block';
   
}

function mostrarCreadasVsVendidas(semanas, tipo) 
{	
	var _base_url = '<?php echo site_url()."/indicadoresgventas24h/detalleIndicadoresVenta"?>';
    $("#ventanaCompaniasExpress").load(_base_url, {semana:semanas, type:tipo}, function(){
           var tamanoDiv = $(this).css('width');
           var tamanoBody =  $("body").css('width');
           
           var widthDiv = tamanoDiv.split('p');
           var widthBody = tamanoBody.split('p');

           var marginLeft = (widthBody[0]-widthDiv[0])/2+'px';

  	       $(this).show();
  	       $(this).css("margin-top",'100px');
    	   $(this).css("margin-left", marginLeft);
     });
  
   
 
    
}

function ocultarVentana(idVentana)
{
    var ventana = document.getElementById(idVentana);
    ventana.style.display = 'none';
}

function show(){
	object=window.open("detallesefectividad_view.php", "miVentana", "directories=no, menubar =no,status=no,toolbar=no,location=no,scrollbars=no,fullscreen=no,height=300,width=600");    
	
}

</script>

<div id="ventanaCompaniasExpressP">

</div>


<div class="table_container">
	<table>
		<tr>
			<td align="center">
				<b><h2><?php echo $recomendacionBalance;?></h2></b>
				<?php echo $balanceCompaniasExpress;?>
			</td>
			<td>
				<?php echo $companiasPorEstatus;?>
			</td>
		</tr>
		<tr>
			<td>
				<?php echo $efectividadExpressEntreCantidad;?>
				<div style=" width:auto; height: 15px; text-align: center;">
 					<b><a onclick="javascript:mostrarVentana('ventanaDetalles')" style="cursor:pointer">Ver Listado</a></b>
 				</div>
			</td>
			<td align="center">
				<b style="font-size: 14px;">Promedio efectividad 4 Semanas mas Recientes (EXPRESS)</b>
				<?php echo $promedioUltimasSemanas;?>
			</td>
		</tr>
		<tr>
			<td><?php echo $promedioDiasExpress;?></td>
			<td align="center">
				<b style="font-size: 14px;">Express Creadas Vs. Vendidas</b>
				<br/><br/>
				<?php echo $expressCreadasVsVendidas;?>
			</td>
		</tr>
	</table>
</div>
<div id="ventanaDetalles" style="position: fixed; overflow: scroll; width: 750px; height: 250px; top: 0; left: 0; font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; border: #223a4d 3px solid; background-color: #FAFAFA; color: #000000; display:none;">
<a onclick = "ocultarVentana('ventanaDetalles');" style="cursor:pointer">Cerrar Ventana</a><br/><br/>
<table>
	<thead>
		<td>REFERENCIA</td>
		<td>SEMANA</td>
		<td>FECHA INICIAL</td>
		<td>FECHA VENTA</td>
		<td>DIAS</td>
		<td>RESULTADO</td>
	</thead>
	<tbody>
		 <?php foreach ($detallesExpress as $detalles):
		 		  echo '<tr>';
			 		  foreach ($detalles as $key=>$value):
	                  echo '<td>';
	                   		echo '<b>'.$detalles[$key].'</b>';
	                   		
	                  echo '</td>';
	                  endforeach;
                  echo '</tr>';                  
        	   endforeach;
         ?> 
	</tbody>
</table>
</div>

<div id="ventanaCompaniasExpress" style="position: fixed; overflow: scroll; width: 670px; height: 250px; top: 0; left: 0; font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; border: #223a4d 3px solid; background-color: #FAFAFA; color: #000000; display:none;">

</div>
